package com.newcoder.community.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.newcoder.community.dao.DiscussPostMapper;
import com.newcoder.community.entity.DiscussPost;
import com.newcoder.community.service.DiscussPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussPostServiceImpl implements DiscussPostService {

    @Autowired
    DiscussPostMapper mapper;

    @Override
    public List<DiscussPost> findDiscussPost(int userId, int start, int pageNum) {
        PageHelper.startPage(start, pageNum);
        List<DiscussPost> posts = mapper.findDiscussPost(userId);
        return posts;
    }
}
